package org.openkanban.server.domain;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;

/**
 * entity class for board
 */
@Entity
public class Board implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long boardId;

    private String boardName;

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    private Set<Activity> activities = new HashSet<Activity>();

    @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    private Set<User> boardUser = new HashSet<User>();

    public Board() {
    }

    public Long getBoardId() {
	return boardId;
    }

    public void setBoardId(Long boardId) {
	this.boardId = boardId;
    }

    public String getBoardName() {
	return boardName;
    }

    public void setBoardName(String boardName) {
	this.boardName = boardName;
    }

    public Set<Activity> getActivities() {
	return activities;
    }

    public void setActivities(Set<Activity> activities) {
	this.activities = activities;
    }

    public Set<User> getBoardUser() {
	return boardUser;
    }

    public void setBoardUser(Set<User> boardUser) {
	this.boardUser = boardUser;
    }

}
